﻿using Connection.IModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Connection.Model
{
    public class ConversationDetailModel:IConversationDetailModel
    {
        private string _conversationId;
        private string _userId1;
        private string _userId2;
        private ConversationDetailDB _condetaildb = new ConversationDetailDB();

        public ConversationDetailModel()
        {
            this.ConversationId = "";
            this.UserId1 = "";
            this.UserId2 = "";
        }

        public ConversationDetailModel(string _userId1, string _userId2)
        {
            this.UserId1 = _userId1;
            this.UserId2 = _userId2;
        }

        public ConversationDetailModel(string _conversationId, string _userId1, string _userId2)
        {
            this.ConversationId = _conversationId;
            this.UserId1 = _userId1;
            this.UserId2 = _userId2;
        }

        public string ConversationId
        {
            get { return _conversationId; }
            set { _conversationId = value; }
        }

        public string UserId1
        {
            get { return _userId1; }
            set { _userId1 = value; }
        }

        public string UserId2
        {
            get { return _userId2; }
            set { _userId2 = value; }
        }

        public void AddNewConversation()
        {
            _condetaildb.InsertConversationDetail(this.ConversationId, this.UserId1, this.UserId2);
        }
    }
}
